const PermissionModel = require("../model/PermissionModel")


const PermissionServices = {
    find:(id) =>{
        let searchId = {
            parentid:id
        }
        return PermissionModel.find(id ? searchId : null)
    },
    append:(permission) => {
        return PermissionModel.create(permission)
    },
    update:(permission) =>{
        return PermissionModel.updateOne(permission)
    },
    remove:(id) =>{
        return PermissionModel.deleteOne(id)
    }
}

module.exports = PermissionServices